Skip to content

Added .NET 6.0 support#27

Merged
IvanMurzak merged 12 commits into
mainfrom
feature/net6.0
Nov 9, 2025
Merged

Added .NET 6.0 support#27
IvanMurzak merged 12 commits into
mainfrom
feature/net6.0

Conversation

@IvanMurzak
Copy link
Copy Markdown
Owner

This pull request adds support for the net6.0 target framework to the main library and test projects, ensuring compatibility with older .NET versions. It also introduces conditional package references for net6.0 to use appropriate package versions, and updates some tests to handle framework-specific behaviors.

Framework and Package Compatibility:

  • Added net6.0 as a target framework to ReflectorNet, ReflectorNet.Tests, and ReflectorNet.Tests.OuterAssembly projects for broader .NET compatibility. [1] [2] [3]
  • Introduced conditional ItemGroups in .csproj files to reference System.Text.Json and other packages with versions compatible with net6.0, while newer frameworks use the latest versions. [1] [2] [3]
  • Updated test project package references, ensuring Microsoft.NET.Test.Sdk and xunit.runner.visualstudio use versions that support net6.0.

Test Improvements and Framework-specific Handling:

  • Updated test code to use a JsonSerializerOptions with a DefaultJsonTypeInfoResolver, improving serialization compatibility across frameworks.
  • Added framework-specific test cases using #if NET8_0_OR_GREATER to ensure correct nullability checks for generic type parameters only on supported frameworks. [1] [2]

@IvanMurzak IvanMurzak requested a review from Copilot November 9, 2025 10:10
@IvanMurzak IvanMurzak self-assigned this Nov 9, 2025
@IvanMurzak IvanMurzak added the enhancement New feature or request label Nov 9, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 9, 2025

Test Results

    3 files      3 suites   3m 23s ⏱️
  552 tests   552 ✅ 0 💤 0 ❌
1 618 runs  1 618 ✅ 0 💤 0 ❌

Results for commit 961afea.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds .NET 6.0 support to ReflectorNet and its test projects, expanding compatibility from the previous .NET 8.0+ and netstandard2.1 baseline. The changes introduce framework-specific package references and conditional compilation directives to handle differences in nullability detection across framework versions.

  • Added net6.0 to target frameworks across all projects
  • Implemented conditional package references for framework-specific dependencies
  • Consolidated repetitive test methods into parameterized theories to reduce code duplication

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ReflectorNet/ReflectorNet.csproj Added net6.0 target framework with conditional package references for Microsoft.Extensions.Logging and System.Text.Json
ReflectorNet.Tests/ReflectorNet.Tests.csproj Added net6.0 target framework with framework-specific test SDK and dependency versions
ReflectorNet.Tests.OuterAssembly/ReflectorNet.Tests.OuterAssembly.csproj Added net6.0 target framework with conditional System.Text.Json package reference
ReflectorNet.Tests/Utils/MethodUtilsTests.cs Added conditional compilation directives to exclude nullable generic type tests on frameworks below .NET 8.0
ReflectorNet.Tests/SchemaTests/ReturnSchemaTests.cs Refactored repetitive test methods into parameterized theories using InlineData attributes, added helper methods, and introduced method name constants
ReflectorNet.Tests/SchemaTests/CollectionsTests.cs Added TypeInfoResolver to JsonSerializerOptions for .NET 6.0 compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ReflectorNet.Tests/SchemaTests/ReturnSchemaTests.cs Outdated
Comment thread ReflectorNet/ReflectorNet.csproj
Comment thread ReflectorNet.Tests/SchemaTests/ReturnSchemaTests.cs
@IvanMurzak IvanMurzak marked this pull request as ready for review November 9, 2025 10:55
@IvanMurzak IvanMurzak requested a review from Copilot November 9, 2025 10:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

ReflectorNet.Tests/ReflectorNet.Tests.csproj:25

  • The version '3.1.5' of xunit.runner.visualstudio does not exist. As of January 2025, the latest stable version is in the 2.x range (e.g., 2.8.2). This should be changed to a valid version such as '2.8.2' (same as the .NET 6.0 configuration).
    <PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ReflectorNet.Tests/SchemaTests/ReturnSchemaTests.cs
@IvanMurzak IvanMurzak merged commit 5398110 into main Nov 9, 2025
8 checks passed
@IvanMurzak IvanMurzak deleted the feature/net6.0 branch November 9, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants